package com.lwq.manager;

import com.lwq.model.SysLog;
import com.lwq.service.LogService;
import com.lwq.util.SpringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.TimerTask;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/6/15
 */
public class AsyncFactory {

    private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");

    /**
     * 操作日志记录
     *
     * @param sysLog 操作日志信息
     * @return 任务task
     */
    public static TimerTask recordOper(final SysLog sysLog)
    {
        return new TimerTask()
        {
            @Override
            public void run()
            {
                SpringUtils.getBean(LogService.class).add(sysLog);
            }
        };
    }
}
